package com.lvhaosb.newpneumonia.tools;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 时间 工具
 */
public class TimeTool {
    private DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    public String localDateTimeToString(LocalDateTime time) {
        return dateTimeFormatter.format(time);
    }

    public LocalDateTime stringToLocalDateTime(String s){
        return LocalDateTime.parse(s, dateTimeFormatter);
    }
}
